<script setup lang="ts">
import notebookImg from '@/assets/images/home/design/banner_1_notebook.png';

const emits = defineEmits(['scrollToAnchor']);
const scrollToAnchor = () => {
  emits('scrollToAnchor');
};
</script>

<template>
  <div class="home_banner">
    <div class="container">
      <div class="topBox">
        <div class="topBox_left">
          <img v-lazy="notebookImg" alt="" />
        </div>
        <div class="topBox_right">
          <div class="company">
            <i class="icon iconfont icon-qiyegongchangjianzhu"></i>
            <span>香港云桥通信息科技有限公司</span>
          </div>
          <div class="title">让连接更简单！</div>
          <div class="content">
            以香港为中心，辐射全球，为客户提供广泛的网络传输服务
            <br />
            打造安全，专业，稳定，高效，快捷的服务平台
          </div>
          <div class="contact" @click="scrollToAnchor">
            <span>联系我们 ></span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.home_banner {
  margin-top: -100px;
  padding-top: 230px;
  width: 100%;
  height: 100vh;
  background-image: url('@/assets/images/home/banner/banner_1.png');
  background-size: cover; /* 自动裁剪图片至容器大小，保持宽高比 */
  background-repeat: no-repeat;
  background-position: center center; /* 将图片内容始终居中显示 */
  .topBox {
    display: flex;
    justify-content: space-between;
    .topBox_left {
      img {
        width: 457px;
        height: auto;
      }
    }
    .topBox_right {
      padding-top: 58px;
      width: 700px;
      // height: 358px;
      display: flex;
      align-items: end;
      flex-direction: column;
      .company {
        width: 380px;
        height: 42px;
        background-color: #5151ff;
        border-radius: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-left: 3px;
        padding-right: 22px;

        i {
          padding: 5px 22px 3px 22px;
          margin-bottom: 1px;
          font-size: 28px;
          color: #fff;
          background-color: #12b9ff;
          border-radius: 18px;
          line-height: 1;
        }

        span {
          font-size: 20px;
          font-weight: normal;
          font-stretch: normal;
          line-height: 28px;
          letter-spacing: 0px;
          color: #ffffff;
        }
      }

      .title {
        margin-top: 31px;
        margin-right: -35px;
        font-family: 'SourceHanSansCN-Bold';
        font-size: 56px;
        font-weight: 700;
        font-stretch: normal;
        line-height: 1;
        letter-spacing: 9px;
        color: #fbf8f8;
      }
      .content {
        margin-top: 36px;
        font-family: 'SourceHanSansCN-Regular';
        font-size: 26px;
        font-weight: normal;
        font-stretch: normal;
        line-height: 44px;
        letter-spacing: 0px;
        color: #1d4e8c;
        text-align: right;
        white-space: nowrap;
      }

      .contact {
        margin-top: 60px;
        width: 163px;
        height: 50px;
        background-color: #ffffff;
        box-shadow: 7px 5px 10px 0px rgba(255, 255, 255, 0.36);
        border-radius: 25px;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        padding-left: 10px;
        span {
          font-family: 'SourceHanSansCN-Bold';
          font-size: 20px;
          color: #1d4e8c;
        }

        &:hover {
          background-color: #d4eef4;
        }
      }
    }
  }
}

// xl(1200px)至xxl(1600px)
@media screen and (min-width: 1201px) and (max-width: 1600px) {
  .container {
    width: 85%;
  }
}
// lg(992px)至xl(1200px)
@media screen and (min-width: 993px) and (max-width: 1200px) {
  .home_banner {
    .container {
      .topBox {
        display: flex;
        flex-direction: column;
        align-items: center;
        .topBox_left {
          img {
            display: none;
          }
        }
        .topBox_right {
          width: 100%;
          align-items: center;

          .title {
            white-space: nowrap;
          }

          .content {
            text-align: center;
            white-space: break-spaces;
          }
        }
      }
    }
  }
}

// md(768px)至lg(992px)
// sm(576px)至md(768px)
@media screen and (min-width: 577px) and (max-width: 992px) {
  .home_banner {
    .container {
      width: 100%;
      .topBox {
        display: flex;
        flex-direction: column;
        align-items: center;
        .topBox_left {
          img {
            display: none;
          }
        }
        .topBox_right {
          width: 100%;
          align-items: center;

          .title {
            white-space: nowrap;
          }

          .content {
            font-size: 22px;
            text-align: center;
          }
          .contact {
            margin-top: 30px;
          }
        }
      }
    }
  }
}

// 少于xs(576px) ---- 同上
@media screen and (max-width: 576px) {
  .home_banner {
    .container {
      width: 100%;
      .topBox {
        display: flex;
        flex-direction: column;
        align-items: center;
        .topBox_left {
          img {
            display: none;
          }
        }
        .topBox_right {
          width: 100%;
          align-items: center;
          padding: 0 10px;

          .company {
            min-width: 320px;
            span {
              font-size: 18px;
            }
          }

          .title {
            font-size: 30px;
          }

          .content {
            font-size: 20px;
            text-align: center;
          }

          .contact {
            margin-top: 30px;
          }
        }
      }
    }
  }
}
</style>
